package com.shun.auth;

import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.config.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;

@Slf4j
@EnableAsync
@SpringBootApplication(scanBasePackages = {"com.shun.auth","com.shun.common.exception"})
@EnableFeignClients(basePackages = {"com.shun.upms","com.shun.base"})
public class ShunAuthApp {

    public static void main(String[] args) {
        log.info("启动shun授权服务！");
        SpringApplication authApp = new SpringApplication(ShunAuthApp.class);
        authApp.setBannerMode(Banner.Mode.OFF);
        ApplicationContext context = authApp.run(args);
        Environment env = context.getEnvironment();
        String port = env.getProperty("server.port");
        log.info("shun授权服务启动成功，端口:{}",port);
    }
}
